package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;

public class DiscountCtr
{

    private DiscountList discountList;
    private Discount discount;
    

   
    public DiscountCtr()
    {
        discountList = DiscountList.getInstance();
    }

    public void createDiscount(long discountId, String discountName, String dateFrom, String dateTill, int discountAmount)
    {
       Discount discount = new Discount(discountId, discountName, dateFrom, dateTill, discountAmount);
       discountList.addDiscount(discount);
    }
   
    public void deleteDiscount(long discountId)
    {
        discountList.deleteDiscount(discountId);
    }
    
    public void setDscountName(String discountName, long discountId)
    {
        discountList.findDiscount(discountId).setDiscountName(discountName);
    }
    
    public void setDateFrom(String dateFrom, long discountId)
    {
        discountList.findDiscount(discountId).setDateFrom(dateFrom);
    }
    
    public void setDateTill(String dateTill, long discountId)
    {
        discountList.findDiscount(discountId).setDateTill(dateTill);
    }
    
    public void setDiscountAmount(int discountAmount, long discountId)
    {
        discountList.findDiscount(discountId).setDiscountAmount(discountAmount);
    }
    
    public String getDiscountName(long discountId)
    {
        return discountList.findDiscount(discountId).getDiscountName();
    }
    
    public String getDateFrom(long discountId)
    {
        return discountList.findDiscount(discountId).getDiscountDateFrom();
    }
    
    public String getDateTill(long discountId)
    {
        return discountList.findDiscount(discountId).getDiscountDateTill();
    }
    
    public int getDiscountAmount(long discountId)
    {
        return discountList.findDiscount(discountId).getDiscountAmount();
    }
}
